* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: white;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container {
    text-align: center;
    max-width: 600px;
    width: 100%;
    padding: 20px;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(to right, #ff6b6b, #feca57, #ff9ff3, #54a0ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.game-board {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    flex-wrap: wrap;
}

#tetris {
    border: 3px solid #3498db;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.5);
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 200px;
}

.next-piece {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    border: 2px solid #9b59b6;
}

.next-piece h3 {
    margin-bottom: 10px;
    color: #9b59b6;
}

#nextPiece {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

.score-info {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    text-align: left;
    border: 2px solid #2ecc71;
}

.score-info p {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.score-info p:last-child {
    margin-bottom: 0;
}

.score-info span {
    font-weight: bold;
    color: #2ecc71;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #3498db;
    color: white;
}

.btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    background-color: #7f8c8d;
    cursor: not-allowed;
    transform: none;
}

#aiBtn.active {
    background-color: #e74c3c;
}

#aiBtn.active:hover {
    background-color: #c0392b;
}

.game-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.9);
    padding: 30px;
    border-radius: 15px;
    border: 3px solid #e74c3c;
    display: none;
    z-index: 100;
    box-shadow: 0 0 30px rgba(231, 76, 60, 0.5);
}

.game-message.show {
    display: block;
}

#messageText {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e74c3c;
}

@media (max-width: 768px) {
    .game-board {
        flex-direction: column;
        align-items: center;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    #tetris {
        width: 100%;
        max-width: 300px;
    }
}